<template>
  <div class="card">
    <div class="header">
      <span>{{ city }}</span>
      <span>{{ realtime.info }} {{ realtime.temperature }}℃ </span>
    </div>
    <div class="dec">
      <div>空气质量：{{ realtime.aqi }}</div>
      <div>湿度：{{ realtime.humidity }}</div>
      <div>风向：{{ realtime.direct }}</div>
      <div>风力：{{ realtime.power }}</div>
    </div>
    <div class="container">
      <div>未来五天的天气</div>
      <div class="future">
        <div
          v-for="(item, index) of future"
          :key="index"
        >
          <div>{{item.temperature}}</div>
          <div><span>{{item.weather}}</span></div>
          <div>{{item.date}}</div>
          <!-- <div>{{item.direct}}</div> -->
        </div>
      </div>
    </div>

  </div>
</template>

<script>
export default {
  name: 'Card',
  props: ['city', 'realtime', 'future']
}

</script>

<style scoped>
.card {
  width: 90vw;
  border-radius: 20px;
  box-shadow: 1px 1px 10px;
  overflow: hidden;
  background: #ecf0f1;
}
.header {
  height: 56vw;
  font-size: 46px;
  text-align: center;
  background: #d35400;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dec > div {
  box-sizing: border-box;
  border: 2px solid;
  margin: 4px;
  padding-left: 8px;
}
.container {
  min-height: 34vw;
  background: #27ae60;
  padding-bottom: 10vw;
  padding: 0 8px 10px;
}
.container > :first-child {
  font-weight: 700;
  padding: 8px 4px;
}
.container .future {
  margin: 3px 0;
  display: flex;
}
.container .future > div {
  flex: 1;
  margin: 2px;
  box-shadow: 0 0 4px;
  text-align: center;
  padding: 1px;
  background: #ecf0f1;
  font-size: 14px;
}
</style>
